//
//  MainController.m
//  MyDota
//
//  Created by 濮亚军 on 15/12/2.
//  Copyright © 2015年 濮亚军. All rights reserved.
//

#import "MainController.h"

@interface MainController ()

//底部自定义导航栏
@property(nonatomic, strong)MainBottomView *mainBottomView;

//英雄主界面
@property(nonatomic, strong)HeroMainController *heroMainViewVc;

@end

@implementation MainController
{
    CGFloat bottomY;
    CGFloat bottomHeight;
}
#pragma mark -------底部自定义导航栏-------
-(void)setBottomView
{
    //底部自定义导航栏
    self.mainBottomView = [[MainBottomView alloc]initWithFrame:CGRectMake( 0, bottomY, kScreenWidth, bottomHeight)];
    [self.view addSubview:_mainBottomView];
}

#pragma mark -------设置子controller-------
-(void)setChildController
{
    //英雄界面controller
    self.heroMainViewVc = [[HeroMainController alloc]init];
    self.heroMainViewVc.view.frame = CGRectMake(0, 0, kScreenWidth, self.view.frame.size.height - bottomHeight);
    [self addChildViewController:_heroMainViewVc];
    [self.view addSubview:_heroMainViewVc.view];
}
#pragma mark --------viewDidLoad--------
- (void)viewDidLoad {
    [super viewDidLoad];
    
    //设置navigationBar不透明
    self.navigationController.navigationBar.translucent = NO;
    self.navigationItem.title = @"英雄";
    
    NSLog(@"MainControllerself.view.frame.size.height ===== %f", self.view.frame.size.height);
    
    bottomY = kScreenHeight - 64 - 64 * kHProportion;
    bottomHeight = 64 * kHProportion;
    NSLog(@"bottomY ==== %f  bottomHeight === %f", bottomY, bottomHeight);
    
    //底部自定义导航栏
    [self setBottomView];
    
    //加载子controller
    [self setChildController];
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
